package com.yang.controller.wx;

import com.yang.bean.MarketTopic;
import com.yang.bean.common.BaseRespVo;
import com.yang.bean.common.CommonData;
import com.yang.bean.szy.QueryTopicVo;
import com.yang.service.admin.AdminTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("wx/topic")
public class WxTopicController {
    @Autowired
    AdminTopicService adminTopicService;
    @RequestMapping("detail")
    public BaseRespVo queryTopic(Integer id) {
        QueryTopicVo data = adminTopicService.queryTopic(id);
        return BaseRespVo.ok(data);
    }
    @RequestMapping("related")
    public BaseRespVo<CommonData<MarketTopic>> relatedTopic(Integer id){
        BaseRespVo<CommonData<MarketTopic>> baseRespVo=adminTopicService.relatedTopic(id);
        return baseRespVo;
    }

    @RequestMapping("list")
    public BaseRespVo list(Integer page,Integer limit){
        CommonData commonData = adminTopicService.list(page,limit);
        return BaseRespVo.ok(commonData);
    }
}
